package cn.edu.ctbu.datajpa01.api;

import cn.edu.ctbu.datajpa01.domain.Student;
import cn.edu.ctbu.datajpa01.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
public class StudentApiController {
    @Autowired


    private StudentService studentService;
    @RequestMapping("/student/list")
    public List<Student> list(){
        return studentService.findAll();
    }
}
